class Animal:
    def __init__(self, name, age):
        self.name = name
        self.age = age
        self._stomach = "空的"     # 保护变量
        self.__money = 0    # 私有变量

    def eat(self, food):
        self._stomach = food
        print(f"{self.name}吃了{food}")

    def speak(self):
        print(f"{self.name}, 发出叫声。")


a1 = Animal("a1", 2)
a1.eat("苹果")
a1.speak()
print(a1._stomach)